import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 暗黑模式样式
import 'element-plus/theme-chalk/dark/css-vars.css'
//svg插件需要配置代码
import 'virtual:svg-icons-register'
import App from '@/App.vue'
//@ts-ignore 忽略ts文件检测
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
//引入自定义插件对象
import gloalComponent from '@/components'
//引入模板全局样式
import '@/styles/index.scss'
//引入router
import router from './router'
//引入仓库
import store from './store'

const app = createApp(App)
// 注入element-plus组件
app.use(ElementPlus, {
  locale: zhCn, //element-plus国际化配置
})

const views = import.meta.glob('@/views/*/*.vue')
console.log('111', views)
console.log(import.meta.env) //获取全局变量

//注入整个项目全局组件，使用页面无需使用import引入
app.use(gloalComponent)
//注入模板路由
app.use(router)
//注入仓库
app.use(store)

//引入路由鉴权
import './permisstion'

//挂载
app.mount('#app')
